# $Id: PKGBUILD 82783 2013-01-24 12:34:05Z seblu $
# Maintainer: Sébastien Luttringer <seblu@aur.archlinux.org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Dale Blount <dale@archlinux.org>

pkgname=iperf
pkgver=2.0.5
pkgrel=7
pkgdesc='A tool to measure maximum TCP bandwidth'
arch=('i686' 'x86_64')
license=('custom')
url='http://iperf.sourceforge.net'
depends=('gcc-libs')
install=iperf.install
source=("http://downloads.sourceforge.net/iperf/iperf-$pkgver.tar.gz"
        'iperf-tcp.service'
        'iperf-udp.service'
        'client.cpp.patch')
md5sums=('44b5536b67719f4250faed632a3cd016'
         '1d8660b540aa0db2e627d3d400cb8de4'
         'a27a8d27b1585bc999a04a2f082e2726'
         '82ce63c87cc8bb2f0f94069857ac14a9')

build() {
  cd $pkgname-$pkgver
  # fix FS#25159
  patch -Np1 -i "$srcdir/client.cpp.patch"
  ./configure --prefix=/usr \
              --enable-ipv6 \
              --enable-multicast \
              --enable-threads
  make
}

package() {
  pushd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
  install -Dm644 COPYING "$pkgdir/usr/share/licenses/iperf/LICENSE"
  popd
  # systemd
  install -Dm644 iperf-tcp.service "$pkgdir/usr/lib/systemd/system/iperf-tcp.service"
  install -Dm644 iperf-udp.service "$pkgdir/usr/lib/systemd/system/iperf-udp.service"
}

# vim:set ts=2 sw=2 et:
